<?php
/**
 * Created by PhpStorm.
 * User: xx
 * Date: 2019/3/14
 * Time: 12:46
 */

define('DS', DIRECTORY_SEPARATOR);
define('EXT', '.php');

define('BASEDIR', __DIR__);
define('KANG_PATH', __DIR__);
define('APPDIR', BASEDIR.DS.'APP'.DS);
define('C_PATH', APPDIR.'Controller'.DS);
define('M_PATH', APPDIR.'Model'.DS);
define('V_PATH', BASEDIR.DS.'templates'.DS);
define('CONF_DIR', APPDIR.'Config'.DS);
define('RUNTIME_PATH', BASEDIR.DS.'Runtime'.DS);
define('LOG_PATH', RUNTIME_PATH.'Log'.DS);
define('CACHE_PATH', RUNTIME_PATH . 'cache' . DS);
define('DEBUG',true);

require_once "vendor/autoload.php";

if (DEBUG == true){
    ini_set('display_errors','On');
    $whoops = new \Whoops\Run;
    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
    $whoops->register();
}else{
    ini_set('display_errors','Off');
}

//function __autoload($class)
//{
//    echo str_replace('\\', '/', $class).'.php';
//    require BASEDIR.'/'.str_replace('\\', '/', $class).'.php';
//}

include 'xiaokang/Start.php';
include 'APP/Common/function.php';

spl_autoload_register('\xiaokang\Start::autoload');

xiaokang\Start::run();
